#include <bits/stdc++.h>
namespace scd {
using namespace std;
template <typename Raw = int, typename T = decay_t<Raw>>
inline auto read() -> enable_if_t<is_integral<T>::value, T> {
    T x = 0;
#ifdef USE_IOSTREAM
    cin >> x;
#else
    bool fl = false;
    char c = getchar();
    while (c < '0' || c > '9')
        fl |= (c == '-'), c = getchar();
    while (c >= '0' && c <= '9') {
        x = (x << 3) + (x << 1) + (c ^ 48);
        c = getchar();
    }
    return fl ? -x : x;
#endif
    return x;
}
template <typename Raw, typename T = decay_t<Raw>>
inline auto read() -> enable_if_t<!is_integral<T>::value, T> {
    T x;
    cin >> x;
    return x;
}
template <typename Raw, typename T = decay_t<Raw>>
inline auto read(Raw&& x) -> enable_if_t<is_integral<T>::value> {
#ifdef USE_IOSTREAM
    cin >> x;
#else
    x = 0;
    bool fl = false;
    char c = getchar();
    while (c < '0' || c > '9')
        fl |= (c == '-'), c = getchar();
    while (c >= '0' && c <= '9') {
        x = (x << 3) + (x << 1) + (c ^ 48);
        c = getchar();
    }
#endif
}
inline void read(char* p) {
#ifdef USE_IOSTREAM
    cin >> p;
#else
    char c = getchar();
    while (isspace(c))
        c = getchar();
    while (c != EOF && !isspace(c)) {
        *p++ = c;
        c = getchar();
    }
    *p = '\0';
#endif
}
template <typename T>
inline auto read(T&& x) -> enable_if_t<!is_integral<decay_t<T>>::value> {
    cin >> x;
}
template <typename... T>
inline void read(T&&... x) {
    (read(forward<T>(x)), ...);
}
template <typename Raw = int, typename T = decay_t<Raw>>
inline auto print(Raw x) -> enable_if_t<is_integral<T>::value> {
#ifdef USE_IOSTREAM
    cout << x;
#else
    if (x < 0) {
        putchar('-');
        x = -x;
    }
    if (x > 9)
        print(x / 10);
    putchar(x % 10 + '0');
#endif
}
template <int d = 6, typename Raw = double, typename T = decay_t<Raw>>
inline auto print(Raw x) -> enable_if_t<is_floating_point<T>::value> {
#ifdef USE_IOSTREAM
    cout.precision(d);
    cout << std::fixed << x;
#else
    printf("%.*f", d, x);
#endif
}
inline void print(char x) {
#ifdef USE_IOSTREAM
    cout.put(x);
#else
    putchar(x);
#endif
}
inline void print(const char* x) {
#ifdef USE_IOSTREAM
    cout << x;
#else
    while (*x)
        putchar(*x++);
#endif
}
template <typename Raw, typename T = decay_t<Raw>>
inline auto print(Raw&& x)
    -> enable_if_t<!is_integral<T>::value && !is_floating_point<T>::value> {
    cout << x;
}
template <typename... T>
inline void print(T&&... x) {
    (print(forward<T>(x)), ...);
}
template <typename... T>
inline void printws(T&&... x) {
    (print(forward<T>(x), ' '), ...);
}
template <typename... T>
inline void println(T&&... x) {
    printws(x...);
    print('\n');
}
}  // namespace scd
using namespace scd;

int32_t main(int32_t argc, const char** argv) {
    freopen("minimize.in", "r", stdin);
    freopen("minimize.out", "w", stdout);
#define int long long
    int n = read(), c = read();
    vector<int> a(n);
    for (int& i : a)
        read(i);
    if (!c) {
        println(0);
        return 0;
    }
    int sum = c * (n - 1);
    int res = sum;
    for (int i = 1; i < n; ++i) {
        sum -= c;
        sum += (a[i] - a[i - 1]) * i;
        res = min(res, sum);
    }
    println(res);
    return 0;
}